class Router {
  constructor() {
    this.stack = [];
  }
  get(path, fn) {
    this.stack.push({
      method: 'get',
      path,
      fn
    });
  }
  post(path, fn) {
    this.stack.push({
      method: 'post',
      path,
      fn
    });
  }
  update(path, fn) {
    this.stack.push({
      method: 'update',
      path,
      fn
    });
  }
  delete(path, fn) {
    this.stack.push({
      method: 'delete',
      path,
      fn
    });
  }
  register(konRouter) {
    for(const {method, path, fn} of this.stack) {
      konRouter[method](path, fn);
    }
  }
}

module.exports = Router;